package olap4cloud.hadop.statistic;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;

import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.client.Increment;
import org.apache.hadoop.hbase.client.Put;
import org.apache.log4j.Logger;

public class TaskIncreDataInToDB implements Callable{
	
	private static Logger logger = Logger.getLogger("Batch");
    /**
	 * @uml.property  name="htable"
	 * @uml.associationEnd  multiplicity="(0 -1)" elementType="org.apache.hadoop.hbase.client.Increment"
	 */
    private HTableInterface htable;
    /**
	 * @uml.property  name="listIncrements"
	 * @uml.associationEnd  multiplicity="(0 -1)" elementType="org.apache.hadoop.hbase.client.Increment"
	 */
    private List<Increment> listIncrements = new ArrayList<Increment>();
        
    public TaskIncreDataInToDB ( HTableInterface htable , List<Increment> listIncrements){
    	this.htable = htable;
    	this.listIncrements.addAll(listIncrements);
    }
    
	@Override
	public Object call() throws Exception {
		// TODO Auto-generated method stub
		for (Increment incre : listIncrements){
			htable.increment(incre);
			System.err.print(".");
		}
		System.err.println("Finish");
		return null;
	}
}
